Create the event_window at the right size using the same logic as in
authorOwen Taylor <otaylor@redhat.com>
Fri, 12 Mar 2004 20:48:51 +0000 (20:48 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 12 Mar 2004 20:48:51 +0000 (20:48 +0000)
Fri Mar 12 15:06:44 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkexpander.c (gtk_expander_realize): Create the
        event_window at the right size using the same logic as
        in size_allocate. (#136994, Niklas Knuttson)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkexpander.c

index 9d46ec669ef5204023f91904660234396ceffea6..7b2da00649f72ec58db42a80a959caf7af0e8bcd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Mar 12 15:06:44 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkexpander.c (gtk_expander_realize): Create the
+       event_window at the right size using the same logic as
+       in size_allocate. (#136994, Niklas Knuttson)
+
 2004-03-12  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the
index 9d46ec669ef5204023f91904660234396ceffea6..7b2da00649f72ec58db42a80a959caf7af0e8bcd 100644 (file)
@@ -1,3 +1,9 @@
+Fri Mar 12 15:06:44 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkexpander.c (gtk_expander_realize): Create the
+       event_window at the right size using the same logic as
+       in size_allocate. (#136994, Niklas Knuttson)
+
 2004-03-12  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the
index 9d46ec669ef5204023f91904660234396ceffea6..7b2da00649f72ec58db42a80a959caf7af0e8bcd 100644 (file)
@@ -1,3 +1,9 @@
+Fri Mar 12 15:06:44 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkexpander.c (gtk_expander_realize): Create the
+       event_window at the right size using the same logic as
+       in size_allocate. (#136994, Niklas Knuttson)
+
 2004-03-12  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the
index 9d46ec669ef5204023f91904660234396ceffea6..7b2da00649f72ec58db42a80a959caf7af0e8bcd 100644 (file)
@@ -1,3 +1,9 @@
+Fri Mar 12 15:06:44 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkexpander.c (gtk_expander_realize): Create the
+       event_window at the right size using the same logic as
+       in size_allocate. (#136994, Niklas Knuttson)
+
 2004-03-12  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the
index 9d46ec669ef5204023f91904660234396ceffea6..7b2da00649f72ec58db42a80a959caf7af0e8bcd 100644 (file)
@@ -1,3 +1,9 @@
+Fri Mar 12 15:06:44 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkexpander.c (gtk_expander_realize): Create the
+       event_window at the right size using the same logic as
+       in size_allocate. (#136994, Niklas Knuttson)
+
 2004-03-12  Federico Mena Quintero  <federico@ximian.com>
 
        * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the
index 01a8c8a3b62927d35f37a8de26806eb276818cf4..eace48f0198f8846682f44325faa17527c0c2aa8 100644 (file)
@@ -115,6 +115,9 @@ static void gtk_expander_forall (GtkContainer *container,
 
 static void gtk_expander_activate (GtkExpander *expander);
 
+static void get_expander_bounds (GtkExpander  *expander,
+                                GdkRectangle *rect);
+
 static GtkBinClass *parent_class = NULL;
 
 GType
@@ -382,17 +385,20 @@ gtk_expander_realize (GtkWidget *widget)
   GdkWindowAttr attributes;
   gint attributes_mask;
   gint border_width;
+  GdkRectangle expander_rect;
 
   priv = GTK_EXPANDER (widget)->priv;
   GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
 
   border_width = GTK_CONTAINER (widget)->border_width;
-                                                                                                             
+
+  get_expander_bounds (GTK_EXPANDER (widget), &expander_rect);
+  
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.x = widget->allocation.x + border_width;
-  attributes.y = widget->allocation.y + border_width;
-  attributes.width = widget->allocation.width - 2 * border_width;
-  attributes.height = widget->allocation.height - 2 * border_width;
+  attributes.y = expander_rect.y;
+  attributes.width = MAX (widget->allocation.width - 2 * border_width, 1);
+  attributes.height = expander_rect.width;
   attributes.wclass = GDK_INPUT_ONLY;
   attributes.event_mask = gtk_widget_get_events (widget)     |
                                GDK_BUTTON_PRESS_MASK        |